package com.yanglanting.disk.role.service;

import com.yanglanting.disk.menu.exception.MenuOccupyException;
import com.yanglanting.disk.mybatis.entity.PtRoleEntity;
import com.yanglanting.disk.mybatis.entity.PtUserEntity;
import com.yanglanting.disk.mybatis.flexigrid.PagingEntity;
import com.yanglanting.disk.mybatis.flexigrid.TblResponseEntity;
import com.yanglanting.disk.mybatis.ztree.ZtreeEntity;
import com.yanglanting.disk.role.entity.SearchRoleEntity;
import com.yanglanting.disk.user.exeption.UserOccupyException;

import java.util.List;

public interface RoleService {
    /**
     * 分页查询角色列表
     * @param entity
     * @param paging
     * @return
     */
    TblResponseEntity<PtRoleEntity> queryRoleInfoListByPage(SearchRoleEntity entity, PagingEntity paging);

    /**
     * 查询角色信息
     * @param roleUuid
     * @return
     */
    PtRoleEntity queryRoleInfoById(String roleUuid);

    /**
     * 修改角色信息
     * @param entity
     */
    void modifyRoleInfoById(PtRoleEntity entity);

    /**
     * 增加角色信息
     * @param entity
     */
    void addRoleInfoById(PtRoleEntity entity);

    /**
     * 删除角色信息
     * @param ids
     */
    void deleteRoleByIds(String ids) throws UserOccupyException, MenuOccupyException;

    /**
     * 根据角色查询菜单ztree列表
     * @param roleUuid
     * @return
     */
    List<ZtreeEntity> queryMenuTreeListByRole(String roleUuid);

    /**
     * 保存角色和菜单对应关系
     * @param roleUuidArray
     * @param menuIdArray
     */
    void saveRoleRefMenu(String roleUuidArray, String menuIdArray);

    /**
     *
     * @param entity
     * @param paging
     * @return
     */
    TblResponseEntity<PtUserEntity> queryUsersByRole(SearchRoleEntity entity, PagingEntity paging);
}
